package com.gy.api.mobile.app;

import com.gy.api.base.ApiIndex;
import com.gy.api.base.IDEntity;
import com.gy.api.base.R;
import com.gy.api.pc.filings.domain.vo.WcPatentApplicationRecommendationVO;
import com.gy.api.pc.filings.service.IPatentApplicationService;
import com.gy.api.pc.movie.domain.vo.WcContentExamineDetailVO;
import com.gy.api.pc.movie.domain.vo.WcContentExamineSaveVO;
import com.gy.api.pc.movie.domain.vo.WcContentExamineUpdateVO;
import com.gy.api.pc.movie.service.IWcContentExamineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@Api( tags = ApiIndex.AppWcContentExamineController)
@RequestMapping("/app/system/wcContentExamine")
public class AppWcContentExamineController  {

    @Autowired
    private IWcContentExamineService wcContentExamineService;

    @ApiOperation("(app)新增影片内容审查")
    @PostMapping("/add")
    @ResponseBody
    public R addSave(@RequestBody WcContentExamineSaveVO saveVO) {
        wcContentExamineService.addSave(saveVO);
        return new R();
    }

    @ApiOperation("(app)修改影片内容审查")
    @PostMapping("/edit")
    @ResponseBody
    public R editSave(@RequestBody WcContentExamineUpdateVO saveVO) {
        wcContentExamineService.updateSave(saveVO);
        return new R();
    }

    @ApiOperation("影片内容审查详情")
    @GetMapping("/getById/{id}")
    @ResponseBody
    public R<WcContentExamineDetailVO> edit(@PathVariable("id") String id) {
        WcContentExamineDetailVO vo = wcContentExamineService.selectWcContentExamineDetailById(id);
        return new R(vo);
    }

    @ApiOperation("删除影片内容审查")
    @PostMapping("/remove")
    @ResponseBody
    public R remove(@RequestBody IDEntity id) {
        wcContentExamineService.removeById(id);
        return new R();
    }

    @Autowired
    IPatentApplicationService service;

    @ApiOperation("查询反馈国家电影局信息")
    @GetMapping("/get_recommendation")
    public R<List<WcPatentApplicationRecommendationVO>> getList(@ApiParam(value = "查询参数") @ModelAttribute IDEntity saveVO) throws Exception {
        return new R(service.getRecommendationList(saveVO));
    }

}
